<template>

  <el-select
    v-model="weekId"
    placeholder="请选择星期"
    filterable
    clearable
    :disabled="disabled"
  >
    <el-option
      v-for="dict in weekList"
      :key="dict.value"
      :label="dict.label"
      :value="dict.value"
    />
  </el-select>

</template>

<script>

import {DICT_TYPE} from "@/utils/dict";

export default {
  name: "WeekListSelector",
  props: {
    value: {
      type: String,
      default: ''
    },
    disabled: {
      type: Boolean,
      default: false
    }
  }
  ,
  model: {
    prop: 'value',
    event: 'change'
  },
  data() {
    return {
      weekList: this.getDictDatas(DICT_TYPE.TIME_WEEK_LIST),
      weekId: ''
    };
  },

  created() {
  },

  watch: {
    weekId(value) {
      this.$emit('change', value)
    },
    value: {
      immediate: true,
      handler(value) {
        this.weekId = value;
      }
    }
  },
  methods: {

  }

}
</script>

